#include <cstdio>
#include <windows.h>

using namespace std;

int main(){
	int T;
	scanf("%d", &T);
	for(int t=1; t<=T; t++){
		printf("=== Case %d ===\n", t);
		system("GEN > airport.in");
		system("airport");
		system("BF");
		if(system("fc airport.out airport.ans")){
			printf("WA!\n");
			return 0;
		}
	}
}
